#include<iostream>
#include<queue>
using std::priority_queue;
using std::endl;
using std::cout;
#include<vector>
using std::vector;
using std::ostream;
#include<math.h>
//Point
class Point{
public:
    Point(int x,int y)
    :_x(x)
    ,_y(y){}
    int getX()const{return _x;}
    int getY()const{return _y;}
    friend
    ostream &operator<<(ostream&os,const Point &lhs);
    double getDistance() const
    {
        return hypot(_x, _y);
    }
    bool operator()(const Point&lhs,const Point&rhs){
    if(lhs.getDistance() < rhs.getDistance())
    {
        return true;
    }
    else if(lhs.getDistance() == rhs.getDistance())
    {
        if(lhs.getX() < rhs.getX())
        {
            return true;
        }
        else if(lhs.getX() == rhs.getX())
        {
            if(lhs.getY() < rhs.getY())
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
    else
    {
        return false;
    }

    }
private:
    int _x;
    int _y;
};
ostream &operator<<(ostream&os,const Point &lhs){
    os<<"Point:"<<lhs._x<<" "<<lhs._y;
    return os;
}
#if 0
bool operator<(const Point &lhs, const Point &rhs)
{
    if(lhs.getDistance() < rhs.getDistance())
    {
        return true;
    }
    else if(lhs.getDistance() == rhs.getDistance())
    {
        if(lhs.getX() < rhs.getX())
        {
            return true;
        }
        else if(lhs.getX() == rhs.getX())
        {
            if(lhs.getY() < rhs.getY())
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            return false;
        }
    }
    else
    {
        return false;
    }
}
#endif

void test0(){
    vector<int> numbers = {1,4,5,57,91,23,45};
    priority_queue<int> _pri_que(numbers.begin(),numbers.end());
    while(!_pri_que.empty()){
        cout<<"优先级最高的元素 "<<_pri_que.top()<<endl;
        _pri_que.pop();
    }
    cout<<endl;
}

void test2(){
    vector<Point> arr= {
        Point(1, 2),
        Point(-1, 2),
        Point(9, 4),
        Point(4, 2),
        Point(1, 2),
        Point(1, -2),
        Point(3, 2),
    };
    priority_queue<Point> numbers;
    ///priority_queue<Point,vector<Point>,Point()> _Pro_point;
    //for(size_t idx = 0;idx !=_Pro_point.size();++idx){
        //_Pro_point.push(arr[idx]);
    //}
    //while(!_Pro_point.empty()){
        //cout<<"优先级最高的元素 "<<_Pro_point.top()<<endl;
        //_Pro_point.pop();
    //}
}

int main(void){
    test2();
}